package com.coocaa.ops.admin.v1.timedtask;

import com.coocaa.ops.admin.v1.timedtask.model.TimedInfoModel;
import com.coocaa.ops.admin.v1.timedtask.service.ITimedTaskService;
import com.coocaa.ops.admin.v1.timedtask.service.impl.TimedTaskServiceImpl;
import lombok.Setter;
import org.springframework.util.Assert;

/**
 * @author bijiahao
 * @date : 2018/5/22.
 * @description
 */
public class TimedTaskUtil {
    @Setter
    private static TimedTaskServiceImpl timedTaskService;

    /**
     * 处理版面，板块等定时上架
     *
     * @param timedInfoModel
     * @param resourceType
     */
    public static void handleTimedTask(TimedInfoModel timedInfoModel, String resourceType) {
        getTimedTaskService().handleTimedTask(timedInfoModel, resourceType);
    }

    private static ITimedTaskService getTimedTaskService() {
        Assert.notNull(timedTaskService, "ITimedTaskService实例不能为空！");
        return timedTaskService;
    }
}
